function HandlePageComparisonByYear(gui, operator, now, options) {
  this._gui = gui;
  this._operator = operator;
  this._now = now;
  this._options = options

  this._createElements();
};

HandlePageComparisonByYear.prototype._createElements = function() {
  var _self = this;
  this._popupBox = new PopupBox();
  
  tr = this._gui.detail.mainTable.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.backgroundColor = '#fff';
  td.colSpan = 13;
  td.appendChild(DOMUtils.getLoadingImage());
  
  this._loadData();
};

HandlePageComparisonByYear.prototype._loadData = function() {
  this._results = null;
  this._retrieveResults();
};

HandlePageComparisonByYear.prototype._verifyData = function() {
  if (this._results) {
    this._updateElements();
  }
};

HandlePageComparisonByYear.prototype._retrieveResults = function() {
  var _self = this;
  var args = '';
  new RequestUtils()._mysql('iecompbyyear', args, function(result, params) { _self._results = result;
                                                                              _self._verifyData.call(_self);
                                                                            }, null);
};

HandlePageComparisonByYear.prototype._updateElements = function() {
  var _self = this;

  DOMUtils.removeTableRows(this._gui.detail.mainTable, 1);
  ChartUtils.statsyear(this._gui.detail.graph, this._results);
  
  var total = 0;
  /*--main table--*/
  if (this._results.length == 0) {
    tr = this._gui.detail.mainTable.insertRow(-1);
    td = tr.insertCell(-1);
    td.colSpan = 13;
    td.style.height = '24px';
    td.style.textAlign = 'center';
    td.appendChild(document.createTextNode('N/A'));
  }
  for (var i = 0, il = this._results.length; i < il; i++) {
    var result = this._results[i];
    tr = this._gui.detail.mainTable.insertRow(-1);
    td = tr.insertCell(-1);
    td.className = 'pagecomparisonbyyear_td9';
    td.appendChild(document.createTextNode(result.year));
    td = tr.insertCell(-1);
    td.className = 'pagecomparisonbyyear_td10';
    td.appendChild(document.createTextNode('$' + parseFloat(result.total).toFixed(2)));
    td = tr.insertCell(-1);
    td.className = 'pagecomparisonbyyear_td11';
    td.appendChild(document.createTextNode(result.tolcus));
    td = tr.insertCell(-1);
    td.className = 'pagecomparisonbyyear_td12';
    td.appendChild(document.createTextNode('$' + parseFloat(result.wed).toFixed(2)));
    td = tr.insertCell(-1);
    td.className = 'pagecomparisonbyyear_td11';
    td.appendChild(document.createTextNode(result.wedcus));
    td = tr.insertCell(-1);
    td.className = 'pagecomparisonbyyear_td12';
    td.appendChild(document.createTextNode('$' + parseFloat(result.pre).toFixed(2)));
    td = tr.insertCell(-1);
    td.className = 'pagecomparisonbyyear_td11';
    td.appendChild(document.createTextNode(result.precus));
    td = tr.insertCell(-1);
    td.className = 'pagecomparisonbyyear_td12';
    td.appendChild(document.createTextNode('$' + parseFloat(result.por).toFixed(2)));
    td = tr.insertCell(-1);
    td.className = 'pagecomparisonbyyear_td11';
    td.appendChild(document.createTextNode(result.porcus));
    td = tr.insertCell(-1);
    td.className = 'pagecomparisonbyyear_td12';
    td.appendChild(document.createTextNode('$' + parseFloat(result.eng).toFixed(2)));
    td = tr.insertCell(-1);
    td.className = 'pagecomparisonbyyear_td11';
    td.appendChild(document.createTextNode(result.engcus));
    td = tr.insertCell(-1);
    td.className = 'pagecomparisonbyyear_td12';
    td.appendChild(document.createTextNode('$' + parseFloat(result.oth).toFixed(2)));
    td = tr.insertCell(-1);
    td.className = 'pagecomparisonbyyear_td11';
    td.appendChild(document.createTextNode(result.othcus));
  }
};
